﻿using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ymatou.API.Common;
using Ymatou.Evaluate.Buyer.Model.ApiModel.Response.Operator;
using Ymatou.ServiceCenter;

namespace Ymatou.Evaluate.Buyer.Model.ApiModel.Request.Operator
{
    /// <summary>
    /// 初始化评价状态
    /// </summary>
    [Resource("bevaluateo.iapi.ymatou.com", "api/InitEvaluate", Method.POST, ParameterBuildType.Json)]
    public class InitEvaluateRequest : BaseRequestModel<InitEvaluateResponse>
    {
        public override string ApiName { get { return "api/InitEvaluate"; } }
        public override bool HttpGet { get { return false; } }

        /// <summary>
        /// 订单Id
        /// </summary>
        public int OrderId { get; set; }

        /// <summary>
        /// 买家Id
        /// </summary>
        public int BuyerId { get; set; }

        /// <summary>
        /// 买手Id
        /// </summary>
        public int SellerId { get; set; }
        public override void Validate()
        {
            const string errCode = "-1";
            if (OrderId <= 0)
            {
                throw new BussniessException(errCode, "订单Id非法");
            }
            if (SellerId <= 0)
            {
                throw new BussniessException(errCode, "买手Id非法");
            }
            if (BuyerId <= 0)
            {
                throw new BussniessException(errCode, "买家Id非法");
            }
            base.Validate();
        }
    }
}
